using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ImageAnalystTools._ClassificationandPatternRecognition
{
    /// <summary>
    /// <para>Inspect Training Samples</para>
    /// <para>Estimates the accuracy of individual training samples. The cross validation accuracy is computed using the previously generated classification training result in an .ecd file and the training samples. Outputs include a raster dataset containing the misclassified class values and a training sample dataset with the accuracy score for each training sample.</para>
    /// <para>估计单个训练样本的准确性。交叉验证精度是使用 .ecd 文件中先前生成的分类训练结果和训练样本计算的。输出包括包含错误分类的类值的栅格数据集和包含每个训练样本的准确率分数的训练样本数据集。</para>
    /// </summary>    
    [DisplayName("Inspect Training Samples")]
    public class InspectTrainingSamples : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public InspectTrainingSamples()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input Raster</para>
        /// <para>The input raster to be classified.</para>
        /// <para>要分类的输入栅格。</para>
        /// </param>
        /// <param name="_in_training_features">
        /// <para>Input Training Sample File</para>
        /// <para>A training sample feature class created in the Training Samples Manager pane.</para>
        /// <para>在训练样本管理器窗格中创建的训练样本要素类。</para>
        /// </param>
        /// <param name="_in_classifier_definition">
        /// <para>Input Classifier Definition File</para>
        /// <para>The .ecd output classifier file from any of the train classifier tools. The .ecd file is a JSON file that contains attribute information, statistics, or other information needed for the classifier.</para>
        /// <para>来自任何训练分类器工具的 .ecd 输出分类器文件。.ecd 文件是一个 JSON 文件，其中包含分类器所需的属性信息、统计信息或其他信息。</para>
        /// </param>
        /// <param name="_out_training_feature_class">
        /// <para>Output Training Sample Feature Class with Score</para>
        /// <para>The output individual training samples saved as a feature class. The associated attribute table contains an addition field listing the accuracy score.</para>
        /// <para>输出的单个训练样本保存为要素类。关联的属性表包含一个列出准确率分数的加法字段。</para>
        /// </param>
        /// <param name="_out_misclassified_raster">
        /// <para>Output Misclassified Raster</para>
        /// <para>The output misclassified raster having NoData outside training samples. In training samples, correctly classified pixels are represented as NoData, and misclassified pixels are represented by their class value. The results is an index map of misclassified class values.</para>
        /// <para>输出对具有训练样本外部 NoData 的栅格进行了错误分类。在训练样本中，正确分类的像素表示为 NoData，错误分类的像素由其类值表示。结果是错误分类的类值的索引映射。</para>
        /// </param>
        public InspectTrainingSamples(object _in_raster, object _in_training_features, object _in_classifier_definition, object _out_training_feature_class, object _out_misclassified_raster)
        {
            this._in_raster = _in_raster;
            this._in_training_features = _in_training_features;
            this._in_classifier_definition = _in_classifier_definition;
            this._out_training_feature_class = _out_training_feature_class;
            this._out_misclassified_raster = _out_misclassified_raster;
        }
        public override string ToolboxName => "Image Analyst Tools";

        public override string ToolName => "Inspect Training Samples";

        public override string CallName => "ia.InspectTrainingSamples";

        public override List<string> AcceptEnvironments => ["compression", "configKeyword", "extent", "geographicTransformations", "nodata", "outputCoordinateSystem", "parallelProcessingFactor", "pyramid", "rasterStatistics", "resamplingMethod", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _in_training_features, _in_classifier_definition, _out_training_feature_class, _out_misclassified_raster, _in_additional_raster];

        /// <summary>
        /// <para>Input Raster</para>
        /// <para>The input raster to be classified.</para>
        /// <para>要分类的输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Input Training Sample File</para>
        /// <para>A training sample feature class created in the Training Samples Manager pane.</para>
        /// <para>在训练样本管理器窗格中创建的训练样本要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Training Sample File")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_training_features { get; set; }


        /// <summary>
        /// <para>Input Classifier Definition File</para>
        /// <para>The .ecd output classifier file from any of the train classifier tools. The .ecd file is a JSON file that contains attribute information, statistics, or other information needed for the classifier.</para>
        /// <para>来自任何训练分类器工具的 .ecd 输出分类器文件。.ecd 文件是一个 JSON 文件，其中包含分类器所需的属性信息、统计信息或其他信息。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Classifier Definition File")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_classifier_definition { get; set; }


        /// <summary>
        /// <para>Output Training Sample Feature Class with Score</para>
        /// <para>The output individual training samples saved as a feature class. The associated attribute table contains an addition field listing the accuracy score.</para>
        /// <para>输出的单个训练样本保存为要素类。关联的属性表包含一个列出准确率分数的加法字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Training Sample Feature Class with Score")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_training_feature_class { get; set; }


        /// <summary>
        /// <para>Output Misclassified Raster</para>
        /// <para>The output misclassified raster having NoData outside training samples. In training samples, correctly classified pixels are represented as NoData, and misclassified pixels are represented by their class value. The results is an index map of misclassified class values.</para>
        /// <para>输出对具有训练样本外部 NoData 的栅格进行了错误分类。在训练样本中，正确分类的像素表示为 NoData，错误分类的像素由其类值表示。结果是错误分类的类值的索引映射。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Misclassified Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_misclassified_raster { get; set; }


        /// <summary>
        /// <para>Additional Input Raster</para>
        /// <para>Ancillary raster datasets, such as a multispectral image or a DEM, will be incorporated to generate attributes and other required information for the classifier. This raster is necessary when calculating attributes such as mean or standard deviation. This parameter is optional.</para>
        /// <para>辅助栅格数据集（例如多光谱影像或 DEM）将被合并，以生成分类器的属性和其他所需信息。在计算均值或标准差等属性时，此栅格是必需的。此参数是可选的。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Additional Input Raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_additional_raster { get; set; } = null;


        public InspectTrainingSamples SetEnv(object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object nodata = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object pyramid = null, object rasterStatistics = null, object resamplingMethod = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, nodata: nodata, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, pyramid: pyramid, rasterStatistics: rasterStatistics, resamplingMethod: resamplingMethod, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}